﻿Public Class CustomFileEntry
    Private _ObjectName As String
    Private _ObjectSize As Long = -1
    Private _ObjectType As String
    Private _ObjectModified As DateTime
    Private _ObjectID As String

    ''' <summary>
    ''' The full filename including the prefix
    ''' </summary>
    ''' <returns></returns>
    Public Property ObjectName() As String
        Get
            Return Me._ObjectName
        End Get
        Set
            Me._ObjectName = Value
        End Set
    End Property

    ''' <summary>
    ''' The filename with out the prefix
    ''' </summary>
    ''' <returns></returns>
    Public ReadOnly Property ObjectSafeName() As String
        Get
            Dim oName As String = Me._ObjectName
            If oName.EndsWith(".bzEmpty") = True Then
                'object is a folder
                Dim val() As String = oName.Split("/".ToCharArray)

                Dim ret As String = val(val.Length - 2)

                Return ret
            Else
                'object is a file
                Return oName.Substring(oName.LastIndexOf("/") + 1)
            End If
        End Get
    End Property

    ''' <summary>
    ''' The size of an object
    ''' </summary>
    ''' <returns></returns>
    Public Property ObjectSize() As Long
        Get
            Return Me._ObjectSize
        End Get
        Set
            Me._ObjectSize = Value
        End Set
    End Property

    ''' <summary>
    ''' The type of an object. Directory or File.
    ''' </summary>
    ''' <returns></returns>
    Public Property ObjectType() As String
        Get
            Return Me._ObjectType
        End Get
        Set
            Me._ObjectType = Value
        End Set
    End Property

    ''' <summary>
    ''' The date and time an object was last modified
    ''' </summary>
    ''' <returns></returns>
    Public Property ObjectModified() As DateTime
        Get
            Return Me._ObjectModified
        End Get
        Set
            Me._ObjectModified = Value
        End Set
    End Property

    ''' <summary>
    ''' The file id of an object
    ''' </summary>
    ''' <returns></returns>
    Public Property ObjectID() As String
        Get
            Return Me._ObjectID
        End Get
        Set
            Me._ObjectID = Value
        End Set
    End Property
End Class
